package test.com.sms.selenium.sms.resourcemanagement.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class RmAddCompanyAddContactsPageUtil extends SeleniumPageUtil{
	public final static By CONTACT_LABEL_FIRST_NAME = By.xpath("//*[@id='subContractorContact']/div[3]/div[1]/div[1]/label");
	public final static By CONTACT_INPUT_FIRST_NAME = By.xpath("//form[@id='subContractorContact']//*[@id='firstName']");
	public final static By CONTACT_LABEL_LAST_NAME = By.xpath("//*[@id='subContractorContact']/div[3]/div[2]/div[1]/label");
	public final static By CONTACT_INPUT_LAST_NAME = By.xpath("//form[@id='subContractorContact']//*[@id='lastName']");
	public final static By CONTACT_LABEL_ADDRESS = By.xpath("//*[@id='subContractorContact']/div[3]/div[1]/div[2]/label");
	public final static By CONTACT_INPUT_ADDRESS = By.id("addressContactId");
	public final static By CONTACT_LABEL_PRIMARY_CONTACT = By.xpath("//*[@id='subContractorContact']/div[3]/div[1]/div[3]/label");
	public final static By CONTACT_INPUT_PRIMARY_CONTACT = By.xpath("//form[@id='subContractorContact']//*[@id='primaryContact']");
	public final static By CONTACT_LABEL_CONTACT_TYPE = By.xpath("//*[@id='subContractorContact']/div[3]/div[2]/div[2]/label");
	public final static By CONTACT_SELECT_CONTACT_TYPE = By.id("contactType");
	public final static By CONTACT_INPUT_WORK_EMAIL_DETAIL = By.id("detail1");
	public final static By CONTACT_INPUT_WORK_PHONE_DETAIL = By.id("detail2");
	public final static By CONTACT_LABEL_CONTACT_METHOD = By.xpath("//*[@id='subContractorContact']/div[4]/table/tbody/tr[3]/td[1]/label");
	public final static By CONTACT_SELECT_CONTACT_METHOD = By.id("contactMethodTypeId3");
	public final static By CONTACT_INPUT_CONTACT_DETAIL = By.id("detail3");
	public final static By CONTACT_INPUT_CONTACT_PHONE_EXT = By.id("phoneExtn3");
	public final static By CONTACT_INPUT_CONTACT_PHONE_COUNTRY_CODE = By.id("phoneCountryCode3");
	
	public final static By CONTACT_BUTTON_CONTINUE = By.xpath("//*[@id='subContractorContact']/div[1]/div[2]");
	public final static By CONTACT_BUTTON_CLEAR = By.xpath("//*[@id='subContractorContact']/div[1]/input");
	public final static By CONTACT_BUTTON_CLOSE = By.id("scContactDialogClose");
	
	public static void waitForAddCompanyContactsPageToLoad(){
		SeleniumUtil.waitOnElements(new By[]{
				CONTACT_BUTTON_CONTINUE, CONTACT_BUTTON_CLEAR, CONTACT_BUTTON_CLOSE, CONTACT_INPUT_FIRST_NAME, 
				CONTACT_INPUT_LAST_NAME, CONTACT_INPUT_ADDRESS, CONTACT_SELECT_CONTACT_TYPE, 
				CONTACT_INPUT_WORK_EMAIL_DETAIL, CONTACT_INPUT_WORK_PHONE_DETAIL
		});
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(CONTACT_BUTTON_CONTINUE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(CONTACT_BUTTON_CLEAR)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(CONTACT_BUTTON_CLOSE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(CONTACT_INPUT_WORK_EMAIL_DETAIL)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(CONTACT_SELECT_CONTACT_TYPE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(CONTACT_INPUT_ADDRESS)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(CONTACT_INPUT_LAST_NAME)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(CONTACT_INPUT_FIRST_NAME)));
	}
}
